﻿// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the LGPL License, Version 3.0. See License.txt in the project root for license information.
// Website: https://admin.blazor.zone

using PetaPoco;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;

namespace BlazorAdmin.Models
{
    [PrimaryKey("ID")]
    [TableName($"{nameof(Trace)}s")]
    public class Trace
    {
        /// <summary>
        /// 获得/设置 Id
        /// </summary>
        [NotNull]
        public virtual int ID { get; set; }

        [Display(Name = "登录用户")]
        [NotNull]
        public string UserName { get; set; }

        [DisplayName("IP地址")]
        [NotNull]
        public string IP { get; set; }

        [DisplayName("浏览器")]
        [NotNull]
        public string Browser { get; set; }

        [DisplayName("操作系统")]
        [NotNull]
        public string OS { get; set; }

        [DisplayName("登录地点")]
        [NotNull]
        public string City { get; set; }

        [DisplayName("请求地址")]
        [NotNull]
        public string RequestUrl { get; set; }

        [DisplayName("请求参数")]
        [NotNull]
        public string RequestData { get; set; }

        [DisplayName("用户代理")]
        [NotNull]
        public string UserAgent { get; set; }

        [DisplayName("")]
        [AllowNull]
        public string Referer { get; set; }

        [DisplayName("创建时间")]
        [NotNull]
        public DateTime LogTime { get; set; }
    }
}